# _*_ coding : utf-8 _*_
# @Time : 2023/8/24 12:25
# @Author : 寻梦
# @File : 011_文件读写变量对象序列化
# @Project : code
'''
序列化的两种操作
dumps()

'''
import json

#(1) dumps()
fp=open('test.txt','w')
name_list=['zs','ls']
names=json.dumps(name_list)
print(type(names))
fp.write(names)
fp.close()
fp=open('test.txt','r')
names=fp.readline()
res=json.loads(names)
print(type(res))
print(res)
